jQuery(document).ready(function(){ 

	/* ---------------------------------------------------------------------- */
	/* Portfolio
	/* ---------------------------------------------------------------------- */ 

	// Needed variables
	var $container = $('#portfolio-list');
	var $filter = $('#portfolio-filter');
	var $typeFilter = $('#portfolio-typeFilter');

	// Run Isotope
	$container.isotope({
		filter : '*',
		layoutMode : 'masonry',
		animationOptions : {
			duration : 750,
			easing : 'linear'
		}
	});

	// Isotope Filter 
	$filter.find('a').click(function(){
		var selector = $(this).attr('data-filter');
		$container.isotope({ 
			filter : selector,
			animationOptions: {
				duration : 750,
				easing : 'linear',
				queue : false,
			}
		});
		return false;
	});
	$typeFilter.find('a').click(function(){
		var selector = $(this).attr('data-filter');
		$container.isotope({ 
			filter : selector,
			animationOptions: {
				duration : 750,
				easing : 'linear',
				queue : false,
			}
		});
		return false;
	});

	// Portfolio image animation 
	$container.find('img').adipoli({
		'startEffect' : 'transparent',
		//'hoverEffect' : 'boxRandom',
		'imageOpacity' : 0.6,
		'animSpeed' : 1	,
	});

	// Copy categories to item classes
	$filter.find('a').click(function() {
		var currentOption = $(this).attr('data-filter');
		$filter.find('a').removeClass('current');
		$(this).addClass('current');
	});
	$typeFilter.find('a').click(function() {
		var currentOption = $(this).attr('data-filter');
		$typeFilter.find('a').removeClass('current');
		$(this).addClass('current');
	});

	/* ---------------------------------------------------------------------- */
	/*Fancybox 
	/* ---------------------------------------------------------------------- */
	$container.find('a').fancybox({
		'transitionIn':'elastic',
		'transitionOut':'elastic',
		'speedIn':200, 
		'speedOut':200, 
		'overlayOpacity': 0.6
	});


});